package com.eig.course.controller;

import com.eig.common.entity.course.CheckCourse;
import com.eig.common.entity.course.EduCourse;
import com.eig.common.vo.Result;
import com.eig.course.service.CheckCourseService;
import com.eig.course.service.CoreCourseService;
import com.eig.course.vo.EduCourseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.annotation.Resource;

/**
 * @author ：StudentLsj（李世界）
 * @date ：Created in 2022/12/06 下午 06:06
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("core/checkCourse")
@Api(tags = "课程审核接口")
@EnableSwagger2
public class CheckCourseController {

    @Resource
    private CheckCourseService checkCourseService;

    @PostMapping("/findCourseCheck/{pageCurrent}/{pageSize}")
    @ApiOperation(value = "分页查询", notes = "根据current和pageSize查询")
    public Result findCourse(@PathVariable Integer pageCurrent, @PathVariable Integer pageSize, @RequestBody CheckCourse e) {
        PageRequest pageRequest = PageRequest.of(pageCurrent - 1, pageSize);
        return checkCourseService.queryByPage(e, pageRequest);
    }
    @PostMapping("/updateCourseCheck")
    @ApiOperation(value = "修改")
    public Result updateCourseCheck(  @RequestBody CheckCourse e) {
        return checkCourseService.updateCourseCheck(e);
    }

  }
